import { ViewEvent } from "../../../Const";
import BaseModule from "../../BaseModule";
import SignInDialogView from "./SignInDialogView";

export default class SignInModule extends BaseModule{
    private _view:SignInDialogView=null;
    init():void{
        this.message.on(ViewEvent.SHOW_SIGNIN_DIALOG,()=>{
            if(this._view==null){
                this._view=new SignInDialogView()
                this._view.on('close',()=>{
                    this._view.zoomOut().then(()=>{
                        this.main.removeChild(this._view)
                    })
                })
            }
            this.main.addChild(this._view)
            this._view.zoomIn()
        })
    }
}